package cn.com.Kol.ITPMP.TenMajorAreas.model;

import cn.com.Kol.ITPMP.System.Area;
import cn.com.Kol.ITPMP.System.Process;

import static cn.com.Kol.ITPMP.System.Constants.*;

public class RiskManagement extends Area {

    private Process MakeRiskManagementPlan = new Process(MAKE_RISK_MANAGEMENT_PLAN);
    private Process RiskIdentification = new Process(RISK_IDENTIFICATION);
    private Process QualitativeRiskAnalysis = new Process(QUALITATIVE_RISK_ANALYSIS);
    private Process QuantitativeRiskAnalysis = new Process(QUANTITATIVE_RISK_ANALYSIS);
    private Process MakeRiskResponsePlan = new Process(MAKE_RISK_RESPONSE_PLAN);
    private Process ControlAndMonitorRisks = new Process(CONTROL_AND_MONITOR_RISKS);
    
    private void RishManagementProcess(){
        CreateProcess(MakeRiskManagementPlan);
        CreateProcess(RiskIdentification);
        CreateProcess(QualitativeRiskAnalysis);
        CreateProcess(QuantitativeRiskAnalysis);
        CreateProcess(MakeRiskResponsePlan);
        CreateProcess(ControlAndMonitorRisks);

    }

    public void SetInputs(Process process){
        switch (process.getProcessName()){
            case "规划风险管理":
                process.inputs(PROJECT_MANAGEMENT_PLAN);
                process.inputs(PROJECT_CHARTER);
                process.inputs(STAKEHOLDER_REGISTER);
                process.inputs(ENTERPRISE_ENVIRONMENTAL_FACTORS);
                process.inputs(ORGANIZATIONAL_PROCESS_ASSETS);
                break;
            case "风险识别":
                process.inputs(RISK_MANAGEMENT_PLAN);
                process.inputs(COST_MANAGEMENT_PLAN);
                process.inputs(SCHEDULE_MANAGEMENT_PLAN);
                process.inputs(QUALITY_MANAGEMENT_PLAN);
                process.inputs(HUMAN_RESOURCE_MANAGEMENT_PLAN);
                process.inputs(SCOPE_BASELINE);
                process.inputs(ACTIVITY_COST_ESTIMATE);
                process.inputs(ACTIVITY_DURATION_ESTIMATES);
                process.inputs(STAKEHOLDER_REGISTER);
                process.inputs(PROJECT_FILE);
                process.inputs(PROCUREMENT_FILE);
                process.inputs(ENTERPRISE_ENVIRONMENTAL_FACTORS);
                process.inputs(ORGANIZATIONAL_PROCESS_ASSETS);
                break;
            case "风险定性分析":
                process.inputs(RISK_MANAGEMENT_PLAN);
                process.inputs(SCOPE_BASELINE);
                process.inputs(RISK_REGISTER);
                process.inputs(ENTERPRISE_ENVIRONMENTAL_FACTORS);
                process.inputs(ORGANIZATIONAL_PROCESS_ASSETS);
                break;
            case "风险定量分析":
                process.inputs(RISK_MANAGEMENT_PLAN);
                process.inputs(COST_MANAGEMENT_PLAN);
                process.inputs(SCHEDULE_MANAGEMENT_PLAN);
                process.inputs(RISK_REGISTER);
                process.inputs(ENTERPRISE_ENVIRONMENTAL_FACTORS);
                process.inputs(ORGANIZATIONAL_PROCESS_ASSETS);
                break;
            case "规划风险应对":
                process.inputs(RISK_MANAGEMENT_PLAN);
                process.inputs(RISK_REGISTER);
                break;
            case "控制和监控风险":
                process.inputs(PROJECT_MANAGEMENT_PLAN);
                process.inputs(RISK_REGISTER);
                process.inputs(WORK_PERFORMANCE_DATA);
                process.inputs(WORK_PERFORMANCE_REPORT);
                break;

        }
    }

    public void UseToolAndTech(Process process){
        switch (process.getProcessName()){
            case "规划风险管理":
                process.useToolAndTech(ANALYSIS_TECHNICS);
                process.useToolAndTech(EXPERT_JUDGEMENT);
                process.useToolAndTech(CONFERENCE);
                break;
            case "风险识别":
                process.useToolAndTech(DOCUMENT_REVIEW);
                process.useToolAndTech(INFORMATION_GATHERING_TECHNOLOGY);
                process.useToolAndTech(CHECK_LIST_ANALYSIS);
                process.useToolAndTech(WHAT_IF_ANALYSIS);
                process.useToolAndTech(DIAGRAMMING_TECHNIQUES);
                process.useToolAndTech(SWOT_ANALYSIS);
                process.useToolAndTech(EXPERT_JUDGEMENT);
                break;
            case "风险定性分析":
                process.useToolAndTech(RISK_PROBABILITY_AND_IMPACT_ASSESSMENT);
                process.useToolAndTech(PROBABILITY_AND_IMPACT_MATRIX);
                process.useToolAndTech(RISK_DATA_QUALITY_ASSESSMENT);
                process.useToolAndTech(RISK_CLASSIFICATION);
                process.useToolAndTech(RISK_URGENCY_ASSESSMENT);
                process.useToolAndTech(EXPERT_JUDGEMENT);
                break;
            case "风险定量分析":
                process.useToolAndTech(DATA_COLLECTION_AND_PRESENTATION_TECHNIQUES);
                process.useToolAndTech(QUANTITATIVE_RISK_ANALYSIS_AND_MODELING_TECHNIQUES);
                process.useToolAndTech(EXPERT_JUDGEMENT);
                break;
            case "规划风险应对":
                process.useToolAndTech(NEGATIVE_RISK_OR_THREAT_RESPONSE_STRATEGIES);
                process.useToolAndTech(POSITIVE_RISK_OR_OPPORTUNITY_RESPONSE_STRATEGIES);
                process.useToolAndTech(EMERGENCY_RESPONSE_STRATEGY);
                process.useToolAndTech(EXPERT_JUDGEMENT);
                break;
            case "控制和监控风险":
                process.useToolAndTech(RISK_REASSESSMENT);
                process.useToolAndTech(RISK_AUDITS);
                process.useToolAndTech(VARIANCE_AND_TREND_ANALYSIS);
                process.useToolAndTech(TECHNICAL_PERFORMANCE_MEASUREMENT);
                process.useToolAndTech(RESERVE_ANALYSIS);
                process.useToolAndTech(CONFERENCE);
                break;


        }
    }

    public void SetOutputs(Process process){
        switch (process.getProcessName()){
            case "规划风险管理":
                process.outputs(RISK_MANAGEMENT_PLAN);
                break;
            case "风险识别":
                process.outputs(RISK_REGISTER_PLAN);
                break;
            case "风险定性分析":
                process.outputs(PROJECT_FILE_UPDATE);
                break;
            case "风险定量分析":
                process.outputs(PROJECT_FILE_UPDATE);
                break;
            case "规划风险应对":
                process.outputs(PROJECT_MANAGEMENT_PLAN_UPDATE);
                process.outputs(PROJECT_FILE_UPDATE);
                break;
            case "控制和监控风险":
                process.outputs(WORK_PERFORMANCE_INFO);
                process.outputs(CHANGE_REQUESTS);
                process.outputs(PROJECT_MANAGEMENT_PLAN_UPDATE);
                process.outputs(PROJECT_FILE_UPDATE);
                process.outputs(ORGANIZATIONAL_PROCESS_ASSETS_UPDATE);
                break;
        }

    }

}
